package com.imay.live.proto.helper;

import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;

import com.alibaba.fastjson.JSONObject;
import com.imay.base.helper.NetworkHelper;
import com.imay.base.util.MD5Util;
import com.imay.live.BuildConfig;
import com.imay.live.helper.LocationHelper;
import com.imay.live.helper.UrlHelper;
import com.imay.live.manager.AccountManager;
import com.imay.live.model.UserInfoModel;
import com.imay.live.params.IMParams;

import java.io.File;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * Created by jeaman on 2017/3/30.
 */

public class ProtoHttpFactory extends ProtoFactory {

    //公共参数
    private static String appendCommandParams(String url, int seqId) {
        return (url.contains("?") ? "&" : "?") + "appkey=app&seqid=" + seqId + "&t=" + System.currentTimeMillis();
    }

    //鉴权参数
    private static String appendAuthParams(String url) {
        long uid = AccountManager.getInstance().getUid();
        String accessToken = AccountManager.getInstance().getAccessCode();
        long timestamp = System.currentTimeMillis() / 1000L;
        String signature = MD5Util.getSHA1(uid + "" + timestamp + "" + accessToken);
        if (!TextUtils.isEmpty(signature)) {
            signature = signature.substring(0, 12);
        }
        return (url.contains("?") ? "&" : "?") + "uid=" + uid + "&timestamp=" + timestamp + "&signature=" + signature;
    }

    // 提供给cocos使用
    public static String getAuthParams() {
        long uid = AccountManager.getInstance().getUid();
        String accessToken = AccountManager.getInstance().getAccessCode();
        long timestamp = System.currentTimeMillis() / 1000L;
        String signature = MD5Util.getSHA1(uid + "" + timestamp + "" + accessToken);
        if (!TextUtils.isEmpty(signature)) {
            signature = signature.substring(0, 12);
        }
        return "appkey=app&uid=" + uid + "&timestamp=" + timestamp + "&t=" + timestamp + "&signature=" + signature + "&seqId=" + generateSeqId();
    }

    public static String getAuthParamsAsJson() {
        long uid = AccountManager.getInstance().getUid();
        String accessToken = AccountManager.getInstance().getAccessCode();
        long timestamp = System.currentTimeMillis() / 1000L;
        String signature = MD5Util.getSHA1(uid + "" + timestamp + "" + accessToken);
        if (!TextUtils.isEmpty(signature)) {
            signature = signature.substring(0, 12);
        }

        JSONObject jsonObj = new JSONObject();
        jsonObj.put("uid", uid);
        jsonObj.put("timestamp", timestamp);
        jsonObj.put("t", timestamp);
        jsonObj.put("signature", signature);
        jsonObj.put("seqId", generateSeqId());
        jsonObj.put("appkey", "app");

        return jsonObj.toString();
    }

    //生成http get请求的json字符串
    private static ProtoRequestParams generateHttpGetData(String url) {
        return generateHttpGetData(url, false);
    }

    private static ProtoRequestParams generateHttpGetData(String url, boolean auth) {
        int seqId = generateSeqId();
        String command = COMMAND_PREFIX_HTTP_GET + seqId;
        url += appendCommandParams(url, seqId);
        if (auth) {
            url += appendAuthParams(url);
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("url", url);
        jsonObject.put("type", HTTP_TYPE_GET);
        return new ProtoRequestParams(REQUEST_TYPE_HTTP, command, jsonObject.toJSONString());
    }

    //生成http post请求的json字符串
    private static ProtoRequestParams generateHttpPostData(String url, Map<String, Object> postMap) {
        return generateHttpPostData(url, postMap, false);
    }

    private static ProtoRequestParams generateHttpPostData(String url, Map<String, Object> postMap, boolean auth) {
        int seqId = generateSeqId();
        String command = COMMAND_PREFIX_HTTP_POST + seqId;
        url += appendCommandParams(url, seqId);
        if (auth) {
            url += appendAuthParams(url);
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("url", url);
        jsonObject.put("type", HTTP_TYPE_POST);
        if (postMap != null) {
            StringBuilder postData = new StringBuilder();
            Iterator iterator = postMap.entrySet().iterator();
            while (iterator.hasNext()) {
                try {
                    Map.Entry<String, Object> entry = (Map.Entry<String, Object>) iterator.next();
                    if (entry.getValue() instanceof List) {
                        List<Object> list = (List<Object>) entry.getValue();
                        for (Object obj : list) {
                            if (postData.length() > 0) {
                                postData.append("&");
                            }
                            postData.append(entry.getKey());
                            postData.append("=");
                            if (obj instanceof String) {
                                postData.append(URLEncoder.encode((String) entry.getValue(), "UTF-8"));
                            } else {
                                postData.append(obj);
                            }
                        }
                    } else {
                        if (postData.length() > 0) {
                            postData.append("&");
                        }
                        postData.append(entry.getKey());
                        postData.append("=");
                        if (entry.getValue() instanceof String) {
                            postData.append(URLEncoder.encode((String) entry.getValue(), "UTF-8"));
                        } else {
                            postData.append(entry.getValue());
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            jsonObject.put("data", postData.toString());
        }
        return new ProtoRequestParams(REQUEST_TYPE_HTTP, command, jsonObject.toJSONString());
    }

    //生成http download请求的json字符串
    private static ProtoRequestParams generateHttpDownloadData(String url, File folder) {
        if (!folder.exists()) {
            folder.mkdirs();
        }
        int seqId = generateSeqId();
        String command = COMMAND_PREFIX_HTTP_GET + seqId;
        url += appendCommandParams(url, seqId);
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("url", url);
            jsonObject.put("type", HTTP_TYPE_DOWNLOAD);
            jsonObject.put("folder", folder.getAbsolutePath());
        } catch (Exception e) {
            e.printStackTrace();
        }
        return new ProtoRequestParams(REQUEST_TYPE_HTTP, command, jsonObject.toJSONString());
    }

    /**
     * @return
     */
    public static ProtoRequestParams requestAppActivation(String mac, String imei, String ip, String isp, String channel) {
        String url = UrlHelper.getAppActivationUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("longitude", LocationHelper.getInstance().getLongitude());
        postMap.put("latitude", LocationHelper.getInstance().getLatitude());
        postMap.put("device_os", "android");
        postMap.put("device_os_version", Build.VERSION.SDK_INT);
        postMap.put("device_phone_model", Build.MODEL);
        postMap.put("device_mac", mac);
        postMap.put("device_imei", imei);
        postMap.put("ip", ip);
        postMap.put("isp", isp);
        // 1:wifi;2:移动网络
        int netWork = NetworkHelper.getInstance().getConnectionType();
        postMap.put("net_work", netWork);
        postMap.put("version", BuildConfig.VERSION_NAME);
        postMap.put("channel", channel);
        return generateHttpPostData(url, postMap);
    }

    /**
     * 七牛
     *
     * @param bucket
     * @return
     */
    public static ProtoRequestParams qiniuGetToken(String bucket) {
        String url = UrlHelper.getTokenUrl(bucket);
        return generateHttpGetData(url);
    }

    /**
     * 手机注册
     *
     * @param phoneCountry
     * @param phone
     * @param verifyCode
     * @param secret
     * @param nick
     * @param imgHead
     * @return
     */
    public static ProtoRequestParams requestCreatePhone(int phoneCountry, long phone, String verifyCode, String secret, String nick, String imgHead) {
        final String url = UrlHelper.getRegisterUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("phoneCountry", phoneCountry);
        postMap.put("phone", phone);
        postMap.put("verifyCode", verifyCode);
        postMap.put("secret", secret);
        postMap.put("nick", Uri.encode(nick));
        postMap.put("imgHead", imgHead);
        return generateHttpPostData(url, postMap);
    }

    /**
     * 登录
     *
     * @param phoneCountry
     * @param phone
     * @param password
     * @return
     */
    public static ProtoRequestParams requestLogin(int phoneCountry, long phone, String password) {
        final String url = UrlHelper.getLoginUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("phoneCountry", phoneCountry);
        postMap.put("phone", phone);
        postMap.put("secret", password);
        return generateHttpPostData(url, postMap);
    }

    /**
     * 发送短信验证码
     *
     * @param phoneCountry
     * @param phone
     * @param sendType
     * @return
     */

    public static ProtoRequestParams sendSms(int phoneCountry, long phone, int sendType) {
        final String url = UrlHelper.getSmsUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("phoneCountry", phoneCountry);
        postMap.put("phone", phone);
        postMap.put("sendType", sendType);
        return generateHttpPostData(url, postMap);
    }

    /**
     * QQ登录
     *
     * @param openid
     * @param unionid
     * @param oauthconsumerkey
     * @param accesstoken
     * @return
     */
    public static ProtoRequestParams loginByQQ(String openid, String unionid, String oauthconsumerkey, String accesstoken) {
        final String url = UrlHelper.getLoginQQUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("openid", openid);
        postMap.put("unionid", unionid);
        postMap.put("oauthconsumerkey", oauthconsumerkey);
        postMap.put("accesstoken", accesstoken);
        return generateHttpPostData(url, postMap);
    }

    /**
     * 微信登录
     *
     * @param openid
     * @param unionid
     * @param accesstoken
     * @return
     */
    public static ProtoRequestParams loginByWechat(String openid, String unionid, String accesstoken) {
        final String url = UrlHelper.getWechatUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("openid", openid);
        postMap.put("unionid", unionid);
        postMap.put("accesstoken", accesstoken);
        return generateHttpPostData(url, postMap);
    }

    /**
     * @param accessToken
     * @param openId
     * @return
     */
    public static ProtoRequestParams loginGetWechatInfo(String accessToken, String openId) {
        final String url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" + accessToken + "&openid=" + openId + "&lang=zh_CN";
        return generateHttpGetData(url);
    }

    /**
     * 微博登录
     *
     * @param weibouid
     * @param accesstoken
     * @return
     */
    public static ProtoRequestParams loginByWB(String weibouid, String accesstoken) {
        final String url = UrlHelper.getWBUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("weibouid", weibouid);
        postMap.put("accesstoken", accesstoken);
        return generateHttpPostData(url, postMap);
    }

    /**
     * 检查验证码
     *
     * @param phoneCountry
     * @param phone
     * @param verifyCode
     * @return
     */
    public static ProtoRequestParams checkSms(int phoneCountry, long phone, String verifyCode) {
        final String url = UrlHelper.getCheckSmsUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("phoneCountry", phoneCountry);
        postMap.put("phone", phone);
        postMap.put("verifyCode", verifyCode);
        return generateHttpPostData(url, postMap);
    }

    /**
     * 检查是否上线
     *
     * @param phoneCountry
     * @param phone
     * @return
     */
    public static ProtoRequestParams checkOnline(String phoneCountry, String phone) {
        final String url = UrlHelper.getcheckOnlineUrl(phoneCountry, phone, AccountManager.getInstance().getAccessCode());
        return generateHttpGetData(url);
    }

    /**
     * 重置密码
     *
     * @param phoneCountry
     * @param phone
     * @param verifyCode
     * @param secret
     * @return
     */
    public static ProtoRequestParams resetPsd(int phoneCountry, long phone, String verifyCode, String secret, String snapshot) {
        final String url = UrlHelper.getResetPsdUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("phoneCountry", phoneCountry);
        postMap.put("phone", phone);
        postMap.put("verifyCode", verifyCode);
        postMap.put("secret", secret);
        postMap.put("snapshot", snapshot);
        return generateHttpPostData(url, postMap);
    }

    //举报房间
    public static ProtoRequestParams requestReportRoom(long roomId, long uid, int category, String snapshot) {
        final String url = UrlHelper.getReportUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("reportType", 3);
        postMap.put("roomId", roomId);
        postMap.put("category", category);
        postMap.put("targetUid", uid);
        postMap.put("snapshot", snapshot);
        return generateHttpPostData(url, postMap, true);
    }

    //举报视频
    public static ProtoRequestParams requestReportVideo(long feedId, long uid, int category, String snapshot) {
        final String url = UrlHelper.getReportUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("reportType", 2);
        postMap.put("feedId", feedId);
        postMap.put("category", category);
        postMap.put("targetUid", uid);
        postMap.put("snapshot", snapshot);
        return generateHttpPostData(url, postMap, true);
    }

    //举报图片
    public static ProtoRequestParams requestReportPicture(long feedId, long uid, int category, String snapshot) {
        final String url = UrlHelper.getReportUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("reportType", 1);
        postMap.put("feedId", feedId);
        postMap.put("category", category);
        postMap.put("targetUid", uid);
        postMap.put("snapshot", snapshot);
        return generateHttpPostData(url, postMap, true);
    }

    //举报用户
    public static ProtoRequestParams requestReportUser(long uid, int category, String snapshot) {
        final String url = UrlHelper.getReportUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("reportType", 4);
        postMap.put("category", category);
        postMap.put("targetUid", uid);
        postMap.put("snapshot", snapshot);
        return generateHttpPostData(url, postMap, true);
    }

    //获取开播标签列表
    public static ProtoRequestParams requestLiveSuggest() {
        String url = UrlHelper.getLiveSuggestUrl();
        return generateHttpGetData(url, true);
    }

    //获取推流地址
    public static ProtoRequestParams requestPushUrl() {
        String url = UrlHelper.getStreamInfoUrl();
        return generateHttpGetData(url, true);
    }

    //获取主播设备信息
    public static ProtoRequestParams requestRoomDeviceInfo(long roomId) {
        String url = UrlHelper.getRoomDeviceInfoUrl(roomId);
        return generateHttpGetData(url, true);
    }

    /**
     * 检查昵称重复
     *
     * @param nick
     * @return
     */
    public static ProtoRequestParams checkNick(String nick) {
        final String url = UrlHelper.getCheckNickUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("nick", Uri.encode(nick));
        return generateHttpPostData(url, postMap);
    }

    /**
     * 获取动态列表
     *
     * @param beforeTime
     * @param maxId
     * @param count
     * @return
     */
    public static ProtoRequestParams getFeeds(int beforeTime, int maxId, int count) {
        final String url = UrlHelper.getDynamicsFeeds(beforeTime, maxId, count);
        return generateHttpGetData(url, true);
    }

    /**
     * 封面女郎
     *
     * @return
     */
    public static ProtoRequestParams coverGirls() {
        final String url = UrlHelper.getCoverGirlsUrl();
        return generateHttpGetData(url);
    }

    /**
     * 动态评论列表
     *
     * @param feedId
     * @param sinceId
     * @param maxId
     * @param count
     * @return
     */
    public static ProtoRequestParams feedCommentList(int feedId, int sinceId, int maxId, int count) {
        final String url = UrlHelper.getFeedCommentListUrl(feedId, sinceId, maxId, count);
        return generateHttpGetData(url, true);
    }

    /**
     * 创建以及转发动态
     *
     * @param imgUrl
     * @param videoUrl
     * @param msg
     * @param city
     * @param longitude
     * @param latitude
     * @param repostedFeedId
     * @return
     */
    public static ProtoRequestParams feedCreate(String imgUrl, String videoUrl, String msg, String city, String longitude, String latitude, int repostedFeedId, int familyId) {
        final String url = UrlHelper.getFeedCreateUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("imgUrl", imgUrl);
        postMap.put("videoUrl", videoUrl);
        postMap.put("msg", Uri.encode(msg));
        postMap.put("city", city);
        postMap.put("longitude", longitude);
        postMap.put("latitude", latitude);
        postMap.put("repostedFeedId", repostedFeedId);
        postMap.put("familyId", familyId);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 相关标签及热门动态
     *
     * @param label
     * @return
     */
    public static ProtoRequestParams labelRelated(String label) {
        final String url = UrlHelper.getLabelRelatedUrl(label);
        return generateHttpGetData(url, true);
    }

    /**
     * 标签的最新动态
     *
     * @param label
     * @return
     */
    public static ProtoRequestParams labelNewest(String label, int sinceId, int maxId, int count) {
        final String url = UrlHelper.getLabelNewestUrl(label, sinceId, maxId, count);
        return generateHttpGetData(url, true);
    }

    /**
     * 发布动态推荐标签
     *
     * @return
     */
    public static ProtoRequestParams labelCreateFeedSuggest() {
        final String url = UrlHelper.getLabelCreateFeedSuggestUrl();
        return generateHttpGetData(url, true);
    }

    /**
     * 用户-获取自己关注的用户列表
     *
     * @param start
     * @param count
     * @return
     */
    public static ProtoRequestParams relationFollows(int start, int count) {
        final String url = UrlHelper.getRelationFollowsUrl(start, count);
        return generateHttpGetData(url, true);
    }


    /**
     * 评论
     *
     * @param feedId
     * @param content
     * @param replyToUid
     * @return
     */
    public static ProtoRequestParams commentCreate(int feedId, String content, long replyToUid) {
        final String url = UrlHelper.getCommentCreateUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("feedId", feedId);
        postMap.put("content", Uri.encode(content));
        postMap.put("replyToUid", replyToUid);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 删除评论
     *
     * @param feedId
     * @param commentId
     * @return
     */
    public static ProtoRequestParams commentDel(int feedId, int commentId) {
        final String url = UrlHelper.getCommentDelUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("feedId", feedId);
        postMap.put("commentId", commentId);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 点赞
     *
     * @param feedId
     * @return
     */
    public static ProtoRequestParams likeCreate(int feedId) {
        final String url = UrlHelper.getLikeCreate();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("feedId", feedId);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 取消赞
     *
     * @param feedId
     * @return
     */
    public static ProtoRequestParams likeDel(int feedId) {
        final String url = UrlHelper.getLikeDel();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("feedId", feedId);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 删除动态
     *
     * @param feedId
     * @return
     */
    public static ProtoRequestParams feedDel(int feedId) {
        final String url = UrlHelper.getFeedDelUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("feedId", feedId);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 编辑动态
     *
     * @param feedId
     * @param msg
     * @return
     */
    public static ProtoRequestParams feedModify(int feedId, String msg, int familyId) {
        final String url = UrlHelper.getFeedModifyUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("feedId", feedId);
        postMap.put("msg", Uri.encode(msg));
        postMap.put("familyId", familyId);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 修改密码
     *
     * @param oldSecret
     * @param newSecret
     * @return
     */
    public static ProtoRequestParams changePassword(String oldSecret, String newSecret) {
        final String url = UrlHelper.getChangePasswordUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("oldSecret", oldSecret);
        postMap.put("newSecret", newSecret);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 获取用户信息
     *
     * @param targetUid 如果为空则是获取自己的信息
     * @return
     */
    public static ProtoRequestParams getUserInfo(long targetUid) {
        final String url = UrlHelper.getUserInfoUrl(targetUid);
        return generateHttpGetData(url, true);
    }

    // 获取标签
    public static ProtoRequestParams getHotLabel() {
        final String url = UrlHelper.getDiscoverlabelUrl(1);
        return generateHttpGetData(url, true);
    }

    // 获取推荐标签
    public static ProtoRequestParams getSuggestLabel() {
        final String url = UrlHelper.getSuggestUrl();
        return generateHttpGetData(url, true);
    }

    // 获取热门房间
    public static ProtoRequestParams getRoomSuggest(int start, int count) {
        final String url = UrlHelper.getRoomSuggestUrl(start, count);
        return generateHttpGetData(url, true);
    }

    // 获取超胆播列表
    public static ProtoRequestParams getShortLive(int start, int count) {
        final String url = UrlHelper.getShortLiveUrl(start, count);
        return generateHttpGetData(url, true);
    }

    // 获取超胆播列表
    public static ProtoRequestParams getShortLiveStat() {
        final String url = UrlHelper.getShortLiveStatUrl();
        return generateHttpGetData(url, true);
    }

    // 获取超胆播详细
    public static ProtoRequestParams getShortLiveDetail(int start, int count, int challengeId, int type) {
        final String url = UrlHelper.getShortLiveDetailUrl(start, count, challengeId, type);
        return generateHttpGetData(url, true);
    }

    // 获取某条动态
    public static ProtoRequestParams getFeedInfo(long feedId) {
        final String url = UrlHelper.getFeedInfoUrl(feedId);
        return generateHttpGetData(url, true);
    }

    // 获取某条动态
    public static ProtoRequestParams getFeedAllInfo(String label, int sinceId, int maxId, int count, boolean include) {
        final String url = UrlHelper.getFeedTopicUrl(label, sinceId, maxId, count, include);
        return generateHttpGetData(url, true);
    }

    // iMay名人
    public static ProtoRequestParams getHotImay() {
        final String url = UrlHelper.getHotImayUrl();
        return generateHttpGetData(url, true);
    }
    // iMay名人更多

    /**
     * 名称	格式	描述	必须	默认值
     * 鉴权参数
     * hotType	string	red:红人;art:才艺之星;new:人气新星	否	red
     *
     * @return
     */
    public static ProtoRequestParams getHotImayMore(String hotType) {
        String url = UrlHelper.getHotImayMoreUrl(hotType);
        return generateHttpGetData(url, true);
    }

    // 获取标签房间
    public static ProtoRequestParams getLabelRooms(String label, int start, int count) {
        final String url = UrlHelper.getLabelRoomsUrl(label, start, count);
        return generateHttpGetData(url, true);
    }

    // 获取发现房间v2/info/banners
    public static ProtoRequestParams getBanners() {
        final String url = UrlHelper.getBannersUrl();
        return generateHttpGetData(url, true);
    }

    // 弹窗广告
    public static ProtoRequestParams getAds() {
        final String url = UrlHelper.getAdsUrl();
        return generateHttpGetData(url, true);
    }

    // 获取发现动态贴文
    public static ProtoRequestParams getFeedSuggests(int sinceId, int count) {
        final String url = UrlHelper.getFeedsUrl(sinceId, count);
        return generateHttpGetData(url, true);
    }

    // 获取游戏房间直播room/ingame
    public static ProtoRequestParams getRoomingames(int start, int count) {
        final String url = UrlHelper.getRoomingameUrl(start, count);
        return generateHttpGetData(url, true);
    }

    /**
     * 获取个人信息的动态列表
     *
     * @param uid
     * @param maxId
     * @param count
     * @return
     */
    public static ProtoRequestParams getProfileDynamic(long uid, int maxId, int count) {
        final String url = UrlHelper.getProfileDynamicUrl(uid, maxId, count);
        return generateHttpGetData(url, true);
    }

    /**
     * 获取个人信息的超胆播列表
     *
     * @param maxId
     * @param count
     * @return
     */
    public static ProtoRequestParams getProfileSupper(long targetUid, long maxId, int count) {
        final String url = UrlHelper.getprofileSupperUrl(targetUid, maxId, count);
        return generateHttpGetData(url, true);
    }

    /**
     * 获取个人信息的点赞动态列表
     *
     * @param uid
     * @param beforeTime
     * @param count
     * @return
     */
    public static ProtoRequestParams getProfileLikeDynamic(long uid, int beforeTime, int count) {
        final String url = UrlHelper.getProfileLikeDynamicUrl(uid, beforeTime, count);
        return generateHttpGetData(url, true);
    }

    /**
     * 修改个人资料
     *
     * @return
     */
    public static ProtoRequestParams updateUserInfo(UserInfoModel model) {
        final String url = UrlHelper.getUpdateUserInfoUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("nick", model.getUser().getNick());
        postMap.put("imgHead", model.getUser().getImgHead());
        postMap.put("intro", model.getIntro());
        postMap.put("website", model.getWebsite());
        postMap.put("sex", model.getUser().getSex());
        postMap.put("age", model.getAge());
        postMap.put("email", model.getEmail());
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 关注他人
     *
     * @param followUid
     * @return
     */
    public static ProtoRequestParams createFollow(long followUid) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("followUid", followUid);
        return generateHttpPostData(UrlHelper.getCreateFollowUrl(), postMap, true);
    }

    /**
     * 取消关注
     *
     * @param followUid
     * @return
     */
    public static ProtoRequestParams cancleFollow(long followUid) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("followUid", followUid);
        return generateHttpPostData(UrlHelper.getCancleFollowUrl(), postMap, true);
    }

    /**
     * 互动通知-我的
     *
     * @return
     */
    public static ProtoRequestParams getNoticeMine(int maxId, int sinceId, int count) {
        return generateHttpGetData(UrlHelper.getNoticeMineUrl(maxId, sinceId, count), true);
    }

    public static ProtoRequestParams getwxpayUrl(String id) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("id", id);
        postMap.put("payClient", 2);
        return generateHttpPostData(UrlHelper.getwxpayUrl(), postMap, true);
    }

    public static ProtoRequestParams getalipay(String id) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("id", id);
        postMap.put("payClient", 2);
        return generateHttpPostData(UrlHelper.getalipayUrl(), postMap, true);
    }

    /**
     * 充值价格列表
     *
     * @return
     */
    public static ProtoRequestParams getrechargeList() {
        final String url = UrlHelper.getrechargeListUrl();
        return generateHttpGetData(url, true);
    }

    /**
     * 充值价格列表
     *
     * @return
     */
    public static ProtoRequestParams getrechargeInfo() {
        final String url = UrlHelper.getrechargeInfoUrl();
        return generateHttpGetData(url, true);
    }

    public static ProtoRequestParams getPayRechargeList(int start, int count) {
        final String url = UrlHelper.getrechargeListUrl(start, count);
        return generateHttpGetData(url, true);
    }

    public static ProtoRequestParams getwithdrawList(int start, int count) {
        final String url = UrlHelper.getwithdrawListUrl(start, count);
        return generateHttpGetData(url, true);
    }

    public static ProtoRequestParams getsearchuserList(int start, String name, int count) {
        final String url = UrlHelper.getsearchuserUrl(start, name, count);
        return generateHttpGetData(url, true);
    }

    public static ProtoRequestParams getsearchsuggestUserlList() {
        final String url = UrlHelper.getsearchsuggestUserlUrl();
        return generateHttpGetData(url, true);
    }

    public static ProtoRequestParams getRoomInfo(long roomId) {
        final String url = UrlHelper.getRoomInfoUrl(roomId);
        return generateHttpGetData(url, true);
    }

    public static ProtoRequestParams getsearchlabelList(int start, String name, int count) {
        final String url = UrlHelper.getsearchlabelUrl(start, name, count);
        return generateHttpGetData(url, true);
    }

    /**
     * realNameCheckId.md
     *
     * @return
     */
    public static ProtoRequestParams getrealNameCheckID(String realName, String idNum) {
        final String url = UrlHelper.getcheckIDcardUrl(realName, idNum);
        return generateHttpGetData(url, true);
    }

    /**
     * realNameGetVerifyPara.md
     * 获取支付宝授权的参数
     *
     * @return
     */
    public static ProtoRequestParams getrealNameGetVerifyPara() {
        final String url = UrlHelper.getParaUrl();
        return generateHttpGetData(url, true);
    }

    /**
     * realNameGetVerify.md
     * 获取支付宝实名认证的结果
     *
     * @return
     */
    public static ProtoRequestParams getrealNameGetVerify(String realName, String idNum, String authCode) {
        final String url = UrlHelper.getverifyUrl(realName, idNum, authCode);
        return generateHttpGetData(url, true);
    }

    /**
     * realNameStatus.md
     * 获取实名认证状态
     *
     * @return
     */
    public static ProtoRequestParams getrealNameStatus() {
        final String url = UrlHelper.getrealNamestatusUrl();
        return generateHttpGetData(url, true);
    }

    /**
     * 兑换价格列表
     *
     * @return
     */
    public static ProtoRequestParams getexchangeList() {
        final String url = UrlHelper.getExchangeListUrl();
        return generateHttpGetData(url, true);
    }

    /**
     * 兑换(魅力->魅钻)
     *
     * @return
     */
    public static ProtoRequestParams postexchange(int meili) {
        final String url = UrlHelper.getExchangeUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("meili", meili);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 提现信息
     *
     * @return
     */
    public static ProtoRequestParams getwithdrawInfo() {
        final String url = UrlHelper.getwithdrawInfoUrl();
        return generateHttpGetData(url, true);
    }

    /**
     * 用户收入统计
     *
     * @return
     */
    public static ProtoRequestParams getIncomeInfo() {
        final String url = UrlHelper.getIncomeInfoUrl();
        return generateHttpGetData(url, true);
    }

    /**
     * 提交大V认证
     * account/largeVip/submit
     *
     * @return
     */
    public static ProtoRequestParams getlargeVipSubmit(String verifiedContent) {
        final String url = UrlHelper.getvipsubmitUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("verifiedContent", verifiedContent);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 提交提现申请
     * pay/withdraw
     *
     * @return
     */
    public static ProtoRequestParams getpaywithdraw(int meiLi, String alipayAccount) {
        final String url = UrlHelper.getpaywithdrawUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("meiLi", meiLi);
        postMap.put("alipayAccount", alipayAccount);
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 确认签约
     * pay/confirmSign
     *
     * @return
     */
    public static ProtoRequestParams getconfirmSign() {
        final String url = UrlHelper.getconfirmSignUrl();
        Map<String, Object> postMap = new HashMap<>();
        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 提交实名认证
     * account/realName/submit
     *
     * @return
     */
    public static ProtoRequestParams getrealNameSubmit(int verifyType, String realName, String identificationNum, String identificationFrontUrl, String identificationBackUrl) {
        final String url = UrlHelper.getRealNameSubmitUrl();
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("verifyType", verifyType);
        postMap.put("realName", realName);
        postMap.put("identificationNum", identificationNum);
        postMap.put("identificationFrontUrl", identificationFrontUrl);
        postMap.put("identificationBackUrl", identificationBackUrl);

        return generateHttpPostData(url, postMap, true);
    }

    /**
     * 互动通知-我关注的
     *
     * @return
     */
    public static ProtoRequestParams getNoticeMineFollow(int maxId, int sinceId, int count) {
        return generateHttpGetData(UrlHelper.getNoticeMineFollowUrl(maxId, sinceId, count), true);
    }

    /**
     * 我的- 获取我关注的人列表
     *
     * @return
     */
    public static ProtoRequestParams getMineFollowList(int count, long start, long uid) {
        return generateHttpGetData(UrlHelper.getMineFollowUrl(count, start, uid), true);
    }

    /**
     * 我的- 获取我关注的人列表
     *
     * @return
     */
    public static ProtoRequestParams getMineFansList(int count, long start, long uid) {
        return generateHttpGetData(UrlHelper.getMineFansUrl(count, start, uid), true);
    }

    /**
     * 发现页-排行榜
     *
     * @return
     */
    public static ProtoRequestParams getDiscoverRanking(String rankType, String rankInTime, int count, int start) {
        return generateHttpGetData(UrlHelper.getDiscoverRankingUrl(rankType, rankInTime, count, start), true);
    }

    /**
     * 资料页-收礼排行榜
     *
     * @return
     */
    public static ProtoRequestParams getProfileGetGiftRanking(long targetUid, int count, int start) {
        return generateHttpGetData(UrlHelper.getProfileGetGiftRankingUrl(targetUid, count, start), true);
    }

    /**
     * 资料页-送礼排行榜
     *
     * @return
     */
    public static ProtoRequestParams getProfileSendGiftRanking(long maxId, int count) {
        return generateHttpGetData(UrlHelper.getProfileSendGiftRankingUrl(maxId, count), true);
    }

    //房间7天排行榜
    public static ProtoRequestParams getRoomRanking(long roomId) {
        return generateHttpGetData(UrlHelper.getRoomRankingUrl(roomId), true);
    }

    //房间礼物排行榜
    public static ProtoRequestParams getRoomRankingList(long roomId, int rankType) {
        return generateHttpGetData(UrlHelper.getRoomRankingListUrl(roomId, rankType), true);
    }

    /**
     * 资料页-系统通知
     *
     * @return
     */
    public static ProtoRequestParams getSystemNotice() {
        return generateHttpGetData(UrlHelper.getSystemNoticeUrl(), true);
    }


    //礼物列表
    public static ProtoRequestParams requestGiftList(int getType, int giftType) {
        return generateHttpGetData(UrlHelper.requestGiftList(getType, giftType), true);
    }

    /**
     * 通知-我的合并消息
     *
     * @return
     */
    public static ProtoRequestParams getMineNoticeMerge(long messageId) {
        return generateHttpGetData(UrlHelper.getMineNoticeMergeUrl(messageId), true);
    }

    /**
     * 通知-我关注的合并消息
     *
     * @return
     */
    public static ProtoRequestParams getMineFollowNoticeMerge(long messageId) {
        return generateHttpGetData(UrlHelper.getMineFollowNoticeMergeUrl(messageId), true);
    }

    /**
     * 绑定手机
     */
    public static ProtoRequestParams bindPhone(int phoneCountry, long phone, String verifyCode, String secret) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("phoneCountry", phoneCountry);
        postMap.put("phone", phone);
        postMap.put("verifyCode", verifyCode);
        postMap.put("secret", secret);
        return generateHttpPostData(UrlHelper.getBindPhoneUrl(), postMap, true);
    }

    /**
     * 个人页推荐用户列表
     *
     * @return
     */
    public static ProtoRequestParams getSuggest(int count) {
        return generateHttpGetData(UrlHelper.getSuggestUrl(count), true);
    }

    /**
     * 个人页-系统通知-通知详情
     *
     * @return
     */
    public static ProtoRequestParams getMailRecord(int contentType, int count, long maxId) {
        return generateHttpGetData(UrlHelper.getMailRecordUrl(contentType, count, maxId), true);
    }

    /**
     * 忽略系统未读消息
     */
    public static ProtoRequestParams ignoreSystemNoticeUnread(List<Integer> contentTypes) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("contentTypes", contentTypes);
        return generateHttpPostData(UrlHelper.getMailIgnoreUrl(), postMap, true);
    }

    /**
     * 删除系统通知
     */
    public static ProtoRequestParams deleteSystemNotice(int contentType) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("contentType", contentType);
        return generateHttpPostData(UrlHelper.getMailDeleteUrl(), postMap, true);
    }

    /**
     * 系统红点
     */
    public static ProtoRequestParams getSystemRedPoint() {
        return generateHttpGetData(UrlHelper.getSysRedPointUrl(), true);
    }

    /**
     * 发送私信
     */
    public static ProtoRequestParams sendMessage(long uid, String content) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("yourUid", uid);
        postMap.put("content", content);
        return generateHttpPostData(UrlHelper.getSendMessageUrl(), postMap, true);
    }

    /**
     * 获取私信列表
     */
    public static ProtoRequestParams getRecentContactList(int listOffset, int count) {
        return generateHttpGetData(UrlHelper.getRecentContactUrl(listOffset, count), true);
    }

    /**
     * 获取私信记录
     */
    public static ProtoRequestParams getMessageList(long uid, int listOffset, int count) {
        return generateHttpGetData(UrlHelper.getMessageListUrl(uid, listOffset, count), true);
    }

    /**
     * 获取帮助数据
     */
    public static ProtoRequestParams getHelpList() {
        return generateHttpGetData(UrlHelper.getHelpUrl(), true);
    }

    /**
     * 删除私信
     */
    public static ProtoRequestParams deleteRecentContact(String userChannelId) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("userChannelId", userChannelId);
        return generateHttpPostData(UrlHelper.getDeleteRecentContactUrl(), postMap, true);
    }

    /**
     * 反馈
     */
    public static ProtoRequestParams feedback(String content, String contactInfo) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("content", content);
        postMap.put("contactInfo", contactInfo);
        return generateHttpPostData(UrlHelper.getFeedbackUrl(), postMap, true);
    }

    /**
     * 获取推送设置信息
     */
    public static ProtoRequestParams getPushConfig() {
        return generateHttpGetData(UrlHelper.getPushConfigUrl(), true);
    }

    /**
     * 条款公约
     */
    public static ProtoRequestParams getAgreements() {
        return generateHttpGetData(UrlHelper.getAgreementsUrl(), true);
    }

    /**
     * 获取推送设置信息
     */
    public static ProtoRequestParams setPushConfig(int pushFollowLive, int pushNewFollower, int pushCallLive) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("pushFollowLive", pushFollowLive);
        postMap.put("pushNewFollower", pushNewFollower);
        postMap.put("pushCallLive", pushCallLive);
        return generateHttpPostData(UrlHelper.getSetPushConfigUrl(), postMap, true);
    }

    /**
     * 直播特权
     */
    public static ProtoRequestParams getPermission() {
        return generateHttpGetData(UrlHelper.getPermissionUrl(), true);
    }

    /**
     * 等级规则
     */
    public static ProtoRequestParams getPermissionRule() {
        return generateHttpGetData(UrlHelper.getPermissionRuleUrl(), true);
    }

    /**
     * 私信,设为已读
     */
    public static ProtoRequestParams setRecentContactReaded(long uid) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("yourUid", uid);
        postMap.put("isRead", 1);
        return generateHttpPostData(UrlHelper.getRecentContactReadedUrl(), postMap, true);
    }

    /**
     * 获取服务器列表
     */
    public static ProtoRequestParams getServerList() {
        return generateHttpGetData(UrlHelper.getServerUrl(), false);
    }

    //短直播开播
    public static ProtoRequestParams requestStartShortLive(String city, double latitude, double longitude, int challengeId) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("challengeId", challengeId);
        if (!TextUtils.isEmpty(city)) {
            postMap.put("city", city);
            postMap.put("latitude", (long) (latitude * 1000000));
            postMap.put("longitude", (long) (longitude * 1000000));
        }
        return generateHttpPostData(UrlHelper.getStartShortLiveUrl(), postMap, true);
    }

    //
    public static ProtoRequestParams requestSetChallenge(String authorName, String title, String content, int defMusicId) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("title", title);
        postMap.put("content", content);
        postMap.put("defMusicId", defMusicId);
        if (!TextUtils.isEmpty(authorName)) {
            postMap.put("authorName", authorName);
        }
        return generateHttpPostData(UrlHelper.getSetChallengeUrl(), postMap, true);
    }

    //短直播完成
    public static ProtoRequestParams requestFinishShortLive(long shortLiveId) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("shortLiveId", shortLiveId);
        return generateHttpPostData(UrlHelper.getFinishShortLiveUrl(), postMap, true);
    }

    //取消短直播
    public static ProtoRequestParams requestCancelShortLive(long shortLiveId) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("shortLiveId", shortLiveId);
        return generateHttpPostData(UrlHelper.getCancelShortLiveUrl(), postMap, true);
    }

    //放弃短直播
    public static ProtoRequestParams requestAbortShortLive(long shortLiveId) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("shortLiveId", shortLiveId);
        return generateHttpPostData(UrlHelper.getAbortShortLiveUrl(), postMap, true);
    }

    //观看短直播
    public static ProtoRequestParams requestViewNextShortLive(long lastShortLiveId, long targetShortLiveId, long targetUid) {
        return generateHttpGetData(UrlHelper.getNextShortLiveUrl(lastShortLiveId, targetShortLiveId, targetUid), true);
    }

    //结束观看短直播
    public static ProtoRequestParams requestViewEndShortLive(long shortLiveId) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("shortLiveId", shortLiveId);
        return generateHttpPostData(UrlHelper.getViewEndShortLiveUrl(), postMap, true);
    }

    //获取房间公告
    public static ProtoRequestParams requestRoomTips() {
        return generateHttpGetData(UrlHelper.getRoomTipsUrl(), false);
    }

    /**
     * 忽略未读私信
     *
     * @param ignoreContentTypes
     */
    public static ProtoRequestParams ignorePersonalMail(List<Integer> ignoreContentTypes) {
        Map<String, Object> postMap = new HashMap<>();
        if (!ignoreContentTypes.isEmpty()) {
            postMap.put("contentTypes", ignoreContentTypes);
        }
        return generateHttpPostData(UrlHelper.getPersonalMailIgnoreUrl(), postMap, true);
    }

    /**
     * 删除私信
     */
    public static ProtoRequestParams deleteRecord(long chatRecordId) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("chatRecordId", chatRecordId);
        return generateHttpPostData(UrlHelper.getDeleteRecordUrl(), postMap, true);
    }

    /**
     * 我的挑战信息
     */
    public static ProtoRequestParams getMyInfo(long uid) {
        return generateHttpGetData(UrlHelper.getMyShortLiveInfoUrl(uid), true);
    }

    /**
     * BGM
     */
    public static ProtoRequestParams getMusicList(int musicType) {
        return generateHttpGetData(UrlHelper.getMusicListUrl(musicType), true);
    }

    /**
     * 游戏排行榜是否要显示
     *
     * @return
     */
    public static ProtoRequestParams getRankingGameStatus() {
        return generateHttpGetData(UrlHelper.getSysParam(IMParams.CONFIGSWITCHGAMERANKMAIN), true);
    }

    /**
     * 游戏排行榜
     *
     * @return
     */
    public static ProtoRequestParams getGameRanking() {
        return generateHttpGetData(UrlHelper.getGameRanking(), true);
    }

    /**
     * 获取活动开关
     *
     * @return
     */
    public static ProtoRequestParams getSysparam(String paramKey) {
        return generateHttpGetData(UrlHelper.getSysparamUrl(paramKey), true);
    }

    //观看某主题短直播
    public static ProtoRequestParams requestViewNextShortLiveTopic(long shortLiveId, long nextShortLiveId, long topicId, int type) {
        return generateHttpGetData(UrlHelper.getNextTopicShortLiveUrl(shortLiveId, nextShortLiveId, topicId, type), true);
    }

    //观看某主题短直播
    public static ProtoRequestParams requestViewNextShortLiveFamily(long shortLiveId, long nextShortLiveId, long familyId) {
        return generateHttpGetData(UrlHelper.getNextFamilyShortLiveUrl(shortLiveId, nextShortLiveId, familyId), true);
    }

    // 获取召唤主播的用户列表
    public static ProtoRequestParams getCallLiveList(long targetUid, int count, int maxId) {
        final String url = UrlHelper.getcallLiveUrl(targetUid, count, maxId);
        return generateHttpGetData(url, true);
    }

    // 获取召唤主播
    public static ProtoRequestParams getMakeLive(long targetUid, String message) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("targetUid", targetUid);
        postMap.put("message", message);
        return generateHttpPostData(UrlHelper.getMakeLiveUrl(), postMap, true);

    }

    public static ProtoRequestParams getTopic(long topicId) {
        final String url = UrlHelper.getTopicUrl(topicId);
        return generateHttpGetData(url, true);
    }

    /**
     * 发现页栏目列表
     *
     * @return
     */
    public static ProtoRequestParams getColumns() {
        final String url = UrlHelper.getColumnsUrl();
        return generateHttpGetData(url, true);
    }

    /**
     * === 家族创建 ===
     */
    public static ProtoRequestParams createFamily(String coverUrl, String name, String designation, String announcement) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("coverUrl", coverUrl);
        postMap.put("familyName", name);
        postMap.put("designation", designation);
        postMap.put("announcement", announcement);
        return generateHttpPostData(UrlHelper.createFamilyUrl(), postMap, true);
    }

    /**
     * 编辑家族
     *
     * @param coverUrl
     * @param designation
     * @param announcement
     * @return
     */
    public static ProtoRequestParams modifyFamily(int familyId, String coverUrl, String designation, String announcement) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("familyId", familyId);
        postMap.put("coverUrl", coverUrl);
        postMap.put("designation", designation);
        postMap.put("announcement", announcement);
        return generateHttpPostData(UrlHelper.modifyFamilyUrl(), postMap, true);
    }

    /**
     * 申请加入家族
     *
     * @param familyId
     * @param explain
     * @return
     */
    public static ProtoRequestParams joinFamily(int familyId, String explain) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("familyId", familyId);
        postMap.put("explain", explain);
        return generateHttpPostData(UrlHelper.joinFamilyUrl(), postMap, true);
    }

    /**
     * 获取家族系统个人信息
     *
     * @return
     */
    public static ProtoRequestParams getImUserInfo() {
        return generateHttpGetData(UrlHelper.getImUserInfoUrl(), true);
    }

    /**
     * 寻找家族
     *
     * @return
     */
    public static ProtoRequestParams searchFamily(String name, int start, int count) {
        return generateHttpGetData(UrlHelper.searchFamilyUrl(name, start, count), true);
    }

    /**
     * 推荐家族列表
     *
     * @param start
     * @param count
     * @return
     */
    public static ProtoRequestParams suggestFamily(int start, int count) {
        return generateHttpGetData(UrlHelper.getSuggestFamilyUrl(start, count), true);
    }

    /**
     * 根据用户id获取家族信息
     *
     * @param uid
     * @return
     */
    public static ProtoRequestParams getFamilyInfoByUid(long uid) {
        return generateHttpGetData(UrlHelper.getFamilyInfoByUidUrl(uid), true);
    }

    /**
     * 获取家庭的用户
     *
     * @param familyid
     * @param start
     * @param count
     * @return
     */
    public static ProtoRequestParams getFamilyUsers(int familyid, int start, int count) {
        return generateHttpGetData(UrlHelper.getFamilyUsersUrl(familyid, start, count), true);
    }

    /**
     * 离开家族
     *
     * @return
     */
    public static ProtoRequestParams familyLeave() {
        return generateHttpPostData(UrlHelper.getFamilyLeaveUrl(), null, true);
    }

    /**
     * 获取家族的申请人员列表
     *
     * @return
     */
    public static ProtoRequestParams getFamilyAcceptUsers(int familyid) {
        return generateHttpGetData(UrlHelper.getFamilyAcceptUsersUrl(familyid), true);
    }

    /**
     * 家族成员审核
     *
     * @param ids
     * @param status
     * @return
     */
    public static ProtoRequestParams checkJoinApply(List<Integer> ids, int status) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("ids", ids);
        postMap.put("status", status);
        return generateHttpPostData(UrlHelper.getCheckJoinApplyUrl(), postMap, true);
    }

    /**
     * 家族管理
     * 1:踢出家族, 2:革除职务,3:转移族长,4:任命长老
     *
     * @return
     */
    public static ProtoRequestParams getFamilyUserManager(long uid, int type) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("targetUid", uid);
        postMap.put("type", type);
        return generateHttpPostData(UrlHelper.getUserManagementUrl(), postMap, true);
    }

    /**
     * 获取家族经验配置
     *
     * @return
     */
    public static ProtoRequestParams getExpConfig() {
        return generateHttpGetData(UrlHelper.getExpConfigUrl(), true);
    }

    /**
     * 家族直播
     *
     * @param familyId
     * @param start
     * @param count
     * @return
     */
    public static ProtoRequestParams getFamilyLive(int familyId, int start, int count) {
        return generateHttpGetData(UrlHelper.getFamilyLiveUrl(start, count, familyId), true);
    }

    /**
     * 家族动态
     *
     * @param familyId
     * @param start
     * @param count
     * @return
     */
    public static ProtoRequestParams getFamilyFeed(int familyId, int start, int count, int firstGet) {
        return generateHttpGetData(UrlHelper.getFamilyFeedUrl(start, count, familyId, firstGet), true);
    }

    /**
     * 家族超胆播列表
     *
     * @param familyId
     * @param start
     * @param count
     * @return
     */
    public static ProtoRequestParams getFamilySupperLive(int familyId, int start, int count, int firstGet) {
        return generateHttpGetData(UrlHelper.getFamilySupperLiveUrl(start, count, familyId, firstGet), true);
    }

    /**
     * 家族贡献榜
     *
     * @return
     */
    public static ProtoRequestParams getFamilyRank(int familyId, String rankInTime, int start, int count) {
        return generateHttpGetData(UrlHelper.getFamilyRankUrl(familyId, rankInTime, count, start), true);
    }

    /**
     * 同步动态、超胆播、直播到群聊的设置
     *
     * @return
     */
    public static ProtoRequestParams syncSetting(int syncFeed, int syncShortLive, int syncLive) {
        Map<String, Object> postMap = new HashMap<>();
        postMap.put("syncFeed", syncFeed);
        postMap.put("syncShortLive", syncShortLive);
        postMap.put("syncLive", syncLive);
        return generateHttpPostData(UrlHelper.getSyncSettingUrl(), postMap, true);
    }

    /**
     * 获取活动开关
     * 获取多个
     * @return
     */
    public static ProtoRequestParams getSysparams(String ...paramKey) {
        return generateHttpGetData(UrlHelper.getSysparamsUrl(paramKey), true);
    }


}
